package com.ruiysoft.util;

public class RegularUtil {
	public static boolean isPositiveInteger(Object arg) {
		return arg.toString().matches("[1-9][0-9]*");
	}

	public static boolean isVerification(String verification) {
		return verification.matches("[0-9A-Z]{6}");
	}

	public static boolean isUrl(String url) {
		return false;
	}

	public static boolean isBankCardNo(String bankCardNo) {
		return bankCardNo.matches("^(\\d{16}|\\d{19})$");
	}

	public static boolean isPictureOrNot(String picurl) {
		return picurl.matches("^[(\\w|\\W)]*\\.(jpg|jpeg|gif|bmp|png|JPG|JPEG|GIF|PNG)$");
	}

	public static boolean isSelfPhone(Object phone) {
		return phone.toString().matches("^((13[0-9])|(14[0-9])|(15[^4,\\D])|(17[0-9])|(18[0-9]))\\d{8}$");
	}
	
	public static boolean isPositiveDecimal(String str){  
        return str.matches("\\+{0,1}[0]\\.[0-9]{1,2}|\\+{0,1}[1-9]\\d*\\.[0-9]{1,2}|[1-9][0-9]*");  
    }
	
	public static boolean isMoney(String str){  
		return str.matches("^[0-9]{1,9}(\\.[0-9]{1,2})?$");  
	}
	
	public static boolean isWithdrawalsMoney(String str){  
		return str.matches("^[0-9]{1,10}$");  
	}
	
	public static boolean isWithdrawalsNote(String str){  
		return str.matches("^[0-9a-zA-Z\u4e00-\u9fa5,.!?，。！？\\-+=\\-+=()（）]*$");  
	}
	
	public static boolean isName(String str){  
		return str.matches("^[0-9a-zA-Z\u4e00-\u9fa5（）()]*$");  
	}
	
	public static boolean isBrandName(String str){  
		return str.matches("^[0-9a-zA-Z\u4e00-\u9fa5（）()!！'‘]*$");  
	}
	
	public static boolean isEng(String str){  
		return str.matches("^[a-zA-Z0-9]*$");  
	}
	
	
	public static void main(String[] args) {
		String str="1!1a,2!2";
		
		
//		boolean withdrawalsNote = isWithdrawalsNote("asd10*（asdf）asdf");
		System.out.println(str);
//		System.out.println(test(str));
	}
}
